<!-- 兰文杰 2020-05-26 09:48:55.499 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="/WEB-INF/pages/include/css-resource.jsp"%>
<title>书籍管理</title>
<style type="text/css">
.row {
	margin-bottom: 10px;
}
</style>
</head>
<body>
	<%@include file="/WEB-INF/pages/include/header.jsp"%>
	<nav aria-label="breadcrumb">
		<ol class="breadcrumb">
			<li class="breadcrumb-item"><a
				href="${pageContext.request.contextPath}/main.html"><i
					class="fas fa-home"></i>主页</a></li>
			<li class="breadcrumb-item"><a
				href="${pageContext.request.contextPath}/app/role/index.html">图书管理</a></li>
		</ol>
	</nav>

	<div class="breadcrumb">
	<table border="1">
		<thead>
			<tr>
				<th>标识</th>
				<th>书籍名称</th>
				<th>作者</th>
				<th>出版社</th>
				<th>出版日期</th>
				<th>价格</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${sessionScope.list}" var="obj" varStatus="st">
				<tr>
					<td>${st.index+1}</td>
					<td>${obj.name}</td>
					<td>${obj.author}</td>
					<td>${obj.press}</td>
					<td>${obj.publicationDate}</td>
					<td>${obj.price}</td>
					<td><a href="edit.jsp?id=${st.index}">编辑</a> &nbsp;&nbsp;&nbsp; 
					<a href="#" onclick="delete1(${obj.id})">删除</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>

					<div class="form-group row">
						<div class="col-md-6">
							<button type="submit" class="btn btn-primary btn-block">保存</button>
						</div>
						<div class="col-md-3">
							<a class="btn btn-secondary btn-block"
								href="${pageContext.request.contextPath}/app/role/index.html">返回</a>
						</div>
					</div>
			
				<div class='${code==0?"text-success":"text-danger"}'>${message}</div>
		
		


	<%@include file="/WEB-INF/pages/include/js-resource.jsp"%>
	<script type="text/javascript">
		function selectFunctionModule(id, fgId) {
			selectFg = false;
			$('#F' + fgId + ' input[type="checkbox"]').each(function() {
				if ($(this).is(":checked")) {
					selectFg = true;
					return;
				}
			});
			if (selectFg) {
				$("#" + fgId).prop('checked', true);
			} else {
				$("#" + fgId).prop('checked', false);
			}
		}
		function selectFunctionGroup(id) {
			if ($("#" + id).is(":checked")) {
				$('#F' + id + ' input[type="checkbox"]').each(function() {
					$(this).prop('checked', true);
				});
			} else {
				$('#F' + id + ' input[type="checkbox"]').each(function() {
					$(this).prop('checked', false);
				});
			}
		}
	</script>
</body>
</html>